package com.photoeditor.demo.model.bean.sub;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Lai on 2018/11/7 0007.
 */
public class FunctionBean implements Parcelable {

    private int mFunType;

    private String mStatisticEntranceNew;

    private String mStatisticPageNew;

    private int mBannerResId;

    private int mVideoResId;

    private int mTitleResId;
    // 第一行文案
    private int mContentResId1;
    // 第二行文案
    private int mContentResId2;

    private String mAlias;

    // 尾帧停留时间
    private long mDelay;
    // 视频开始
    private int mStartIndex;
    // 视频结束时间
    private int mEndIndex;

    //是否隐藏视频，如果该值大于0则隐藏视频
    private int mHideVideo = -1;

    public FunctionBean(int funType, String alias, String statisticEntranceNew, String statisticPageNew, int bannerResId, int videoResId, int titleResId, long delay) {
        mFunType = funType;
        mAlias = alias;
        mStatisticEntranceNew = statisticEntranceNew;
        mStatisticPageNew = statisticPageNew;
        mBannerResId = bannerResId;
        mVideoResId = videoResId;
        mTitleResId = titleResId;
        mDelay = delay;
    }
    public FunctionBean(int funType, String alias, String statisticEntranceNew, String statisticPageNew, int bannerResId,
                        int videoResId, int titleResId, int contentResId1, int contentResId2, long delay, int startIndex, int endIndex) {
        mFunType = funType;
        mAlias = alias;
        mStatisticEntranceNew = statisticEntranceNew;
        mStatisticPageNew = statisticPageNew;
        mBannerResId = bannerResId;
        mVideoResId = videoResId;
        mTitleResId = titleResId;
        mContentResId1 = contentResId1;
        mContentResId2 = contentResId2;
        mDelay = delay;
        mStartIndex = startIndex;
        mEndIndex = endIndex;
    }

    public FunctionBean(int funType, String alias, String statisticEntranceNew, String statisticPageNew, int bannerResId,
                        int videoResId, int titleResId, int contentResId1, int contentResId2, long delay, int startIndex, int endIndex,
                        int hideVideo) {
        mFunType = funType;
        mAlias = alias;
        mStatisticEntranceNew = statisticEntranceNew;
        mStatisticPageNew = statisticPageNew;
        mBannerResId = bannerResId;
        mVideoResId = videoResId;
        mTitleResId = titleResId;
        mContentResId1 = contentResId1;
        mContentResId2 = contentResId2;
        mDelay = delay;
        mStartIndex = startIndex;
        mEndIndex = endIndex;
        mHideVideo = hideVideo;
    }

    public int getContentResId1() {
        return mContentResId1;
    }

    public void setContentResId1(int contentResId1) {
        mContentResId1 = contentResId1;
    }

    public int getContentResId2() {
        return mContentResId2;
    }

    public void setContentResId2(int contentResId2) {
        mContentResId2 = contentResId2;
    }

    public String getStatisticEntranceNew() {
        return mStatisticEntranceNew;
    }

    public void setStatisticEntranceNew(String statisticEntranceNew) {
        mStatisticEntranceNew = statisticEntranceNew;
    }

    public String getStatisticPageNew() {
        return mStatisticPageNew;
    }

    public void setStatisticPageNew(String statisticPageNew) {
        mStatisticPageNew = statisticPageNew;
    }

    public int getBannerResId() {
        return mBannerResId;
    }

    public void setBannerResId(int bannerResId) {
        mBannerResId = bannerResId;
    }

    public int getFunType() {
        return mFunType;
    }

    public void setFunType(int funType) {
        mFunType = funType;
    }

    public int getVideoResId() {
        return mVideoResId;
    }

    public void setVideoResId(int videoResId) {
        mVideoResId = videoResId;
    }

    public int getTitleResId() {
        return mTitleResId;
    }

    public void setTitleResId(int titleResId) {
        mTitleResId = titleResId;
    }

    public String getAlias() {
        return mAlias;
    }

    public void setAlias(String alias) {
        mAlias = alias;
    }

    public long getDelay() {
        return mDelay;
    }

    public void setDelay(long delay) {
        mDelay = delay;
    }

    public int getStartIndex() {
        return mStartIndex;
    }

    public void setStartIndex(int startIndex) {
        mStartIndex = startIndex;
    }

    public int getEndIndex() {
        return mEndIndex;
    }

    public void setEndIndex(int endIndex) {
        mEndIndex = endIndex;
    }

    public boolean isHideVideo() {
        return mHideVideo > 0;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.mFunType);
        dest.writeString(this.mStatisticEntranceNew);
        dest.writeString(this.mStatisticPageNew);
        dest.writeInt(this.mBannerResId);
        dest.writeInt(this.mVideoResId);
        dest.writeInt(this.mTitleResId);
        dest.writeInt(this.mContentResId1);
        dest.writeInt(this.mContentResId2);
        dest.writeString(this.mAlias);
        dest.writeLong(this.mDelay);
        dest.writeInt(this.mStartIndex);
        dest.writeInt(this.mEndIndex);
        dest.writeInt(this.mHideVideo);
    }

    protected FunctionBean(Parcel in) {
        this.mFunType = in.readInt();
        this.mStatisticEntranceNew = in.readString();
        this.mStatisticPageNew = in.readString();
        this.mBannerResId = in.readInt();
        this.mVideoResId = in.readInt();
        this.mTitleResId = in.readInt();
        this.mContentResId1 = in.readInt();
        this.mContentResId2 = in.readInt();
        this.mAlias = in.readString();
        this.mDelay = in.readLong();
        this.mStartIndex = in.readInt();
        this.mEndIndex = in.readInt();
        this.mHideVideo = in.readInt();
    }

    public static final Creator<FunctionBean> CREATOR = new Creator<FunctionBean>() {
        @Override
        public FunctionBean createFromParcel(Parcel source) {
            return new FunctionBean(source);
        }

        @Override
        public FunctionBean[] newArray(int size) {
            return new FunctionBean[size];
        }
    };
}
